//
//  MYInputView.h
//  JQLive
//
//  Created by Bruce on 2020/3/14.
//  Copyright © 2020 JQLive. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

///输入类型
typedef NS_ENUM(NSInteger, MYInputViewInputType)
{
    ///键盘
    MYInputViewInputTypeKeyBoard = 0,
    ///录音
    MYInputViewInputTypeVoice = 1,
    ///插件
    MYInputViewInputTypePlugin = 2,
    ///表情
    MYInputViewInputTypeEmoji = 3
};

@class MYInputView;

///聊天输入视图代理
@protocol MYInputViewDelegate <NSObject>

@optional

/**
 *  发送回调
 *
 *  @param inputView 输入视图
 *  @param text      文本
 */
- (void)didInputView:(MYInputView *)inputView sendText:(NSString *)text;

/**
 *  修改frame回调
 *
 *  @param inputView 输入视图
 *  @param frame     frame
 */
- (void)didInputView:(MYInputView *)inputView changeFrame:(CGRect)frame;

/**
 *  点击录音按钮
 *
 *  @param inputView 输入视图
 *  @param button    录音按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(MYInputView *)inputView recodeButton:(UIButton *)button beginTouch:(UITouch *)touch;

/**
 *  点击录音移动按钮
 *
 *  @param inputView 输入视图
 *  @param button    录音按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(MYInputView *)inputView recodeButton:(UIButton *)button moveTouch:(UITouch *)touch;

/**
 *  结束录音回调
 *
 *  @param inputView 输入视图
 *  @param button    按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(MYInputView *)inputView recodeButton:(UIButton *)button endTouch:(UITouch *)touch;

/**
 *  点击插件按钮回调
 *
 *  @param inputView    输入视图
 *  @param pluginButton 插件按钮
 */
- (void)didInputView:(MYInputView *)inputView touchUpInsidePluginButton:(UIButton *)pluginButton;

/**
 *  点击表情按钮回调
 *
 *  @param inputView   输入视图
 *  @param emojiButton 表情按钮
 */
- (void)didInputView:(MYInputView *)inputView touchUpInsideEmojiButton:(UIButton *)emojiButton;

@end

@interface MYInputView : UIView

///输入文本框
@property (nonatomic,readonly) UITextView *textView;
///输入文本框提示
@property (nonatomic,readonly) UILabel *placeHolderLabel;
///语音.键盘按钮
@property (nonatomic,readonly) UIButton *inputTypeButton;
///插件按钮
@property (nonatomic,readonly) UIButton *pluginButton;
///表情按钮
@property (nonatomic,readonly) UIButton *emojiButton;
///录音按钮
@property (nonatomic,readonly) UIButton *recodeButton;
///当前输入类型
@property (nonatomic) MYInputViewInputType inputType;
///代理
@property (nonatomic,weak) id<MYInputViewDelegate> delegate;

@property (nonatomic) BOOL shouldDismiss;

- (void)reset;

- (BOOL)becomeFirstResponder;
- (BOOL)resignFirstResponder;
@end

NS_ASSUME_NONNULL_END
